/*
 * @Author: taiyunhang
 * @Date: 2018-12-12 11:18:40
 * */

import Vue from 'vue';
import VueRouter from 'vue-router';
import {
  routerMode,
  entryPath
} from '@/env';

import Login from '@/views/login/login.vue';
import Home from '@/views/home/home.vue';
import Point from '@/views/point/point.vue';
import City from '@/views/city/city.vue';
import Order from '@/views/order/order.vue';
import Activity from '@/views/activity/activity.vue';
import Personal from '@/views/personal/personal.vue';
import Pay from '@/views/pay/pay.vue';
import Result from '@/views/result/result.vue';

Vue.use(VueRouter);
const routes = [
  /* {
    path: '/',
    redirect: { name: 'home' }
  }, */
  // {
  //   path: entryPath + '/',
  //   name: 'home',
  //   component: Home
  // },
  {
    path: entryPath + '/home',
    name: 'home',
    component: Home
  },
  {
    path: entryPath + '/login',
    name: 'login',
    component: Login
  },
  {
    path: entryPath + '/point',
    name: 'point',
    component: Point
  },
  {
    path: entryPath + '/city',
    name: 'city',
    component: City
  },
  {
    path: entryPath + '/order',
    name: 'order',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: Order
  },
  {
    path: entryPath + '/activity',
    name: 'activity',
    // meta: {
    //   requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    // },
    component: Activity
  },
  {
    path: entryPath + '/personal',
    name: 'personal',
    // meta: {
    //   requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    // },
    component: Personal
  },
  {
    path: entryPath + '/pay',
    name: 'pay',
    // meta: {
    //   requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    // },
    component: Pay
  },
  {
    path: entryPath + '/result',
    name: 'result',
    // meta: {
    //   requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    // },
    component: Result
  }
];

export default new VueRouter({
  // base: entryPath,
  mode: routerMode,
  routes: routes
});
